package com.punai.system.constants;

public class SysLogInfoConstants {
    public enum LogType {
        GJTOPT("0","编制工具-平台"),
        PTTOGJ("1","平台-编制工具"),

        XZDTOPT("2","新中大系统-平台"),
        PTTOXZD("3","平台-新中大系统");

        private String code;
        private String desc;

        LogType(String code,String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getDescByCode(String code) {
            for (SysLogInfoConstants.LogType value : values()) {
                if (value.getCode().equals(code)){
                    return value.getDesc();
                }
            }
            return null;
        }

    }

    public enum TRUEORFALSE {
        FALSE("0","失败"),
        TRUE("1","成功");

        private String code;
        private String desc;

        TRUEORFALSE(String code,String desc) {
            this.code = code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public static String getDescByCode(String code) {
            for (SysLogInfoConstants.TRUEORFALSE value : values()) {
                if (value.getCode().equals(code)){
                    return value.getDesc();
                }
            }
            return null;
        }

    }
}
